using System.BusinessObjects.Transactions;
using NHibernate;

namespace Blazing.BusinessObjects.Queries
{
    public class QrySearchChildMenuItems
    {
        public static IQuery Query(int parentId)
        {
            string nql = "select m from MenuItem m where m.Parent = :parentItem";
            IQuery qry = UnitOfWork.CurrentSession.CreateQuery(nql);
            qry.SetInt32("parentItem", parentId);

            qry.SetCacheable(true);
            return qry;
        }
    }
}
